//
//  main.c
//  TestC
//
//  Created by 杜清 on 2023/12/4.
//

#include <stdio.h>
#include <objc/message.h>
#include <objc/runtime.h>
#include "HelloWord.h"

extern void myObjectiveCMethod();

void callObjectiveCMethod() {
    // 获取 MyClass 类
    Class myClass = objc_getClass("HelloWord");

    // 创建 MyClass 实例
    id myObject = class_createInstance(myClass, 0);

    // 调用 doSomething 方法
    SEL doSomethingSelector = sel_registerName("sayHello");
    ((void (*)(id, SEL))objc_msgSend)(myObject, doSomethingSelector);
}

int main(int argc, const char * argv[]) {
    // insert code here...
    callObjectiveCMethod();
    return 0;
}
